﻿/*
 * 简历信息编辑
 *
 * Copyright (c) 2009 关锦华--示达科技[http://www.yj-star.com]
 *
 * eidtUserInfo()--> 编辑简历基本信息
 * getUserInfo()---> 保存简历基本信息
 *
 * $Date: 2007-09-16 23:42:06 -0400 (Sun, 16 Sep 2007) $
 * $Rev: 3353 $
 */
function editUserInfo(){
var arr = getUserInfoHTML();
var userArr=arr.split(",");
var BPI="<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" class=\"weight780\">\r\n";
            BPI=BPI + "<tr>";
            BPI=BPI + "<td class=\"height10\"/>";
            BPI=BPI + "</tr>";
            BPI=BPI + "<tr>";
            BPI=BPI + "<td valign=\"top\" align=\"right\" class=\"weight125\">姓名：</td>";
            BPI=BPI + "<td valign=\"top\" align=\"left\" class=\"weight120\"><input name=\"u_name\" type=\"text\" class=\"textfield\" id=\"u_name\" value="+userArr[0]+"></td>";
            BPI=BPI + "<td valign=\"top\" align=\"right\" class=\"weight120\">性别：</td>";
            BPI=BPI + "<td valign=\"top\" width=\"210\"><select class=\"selectfield\" name=\"u_sex\" id=\"u_sex\" value="+userArr[1]+"><option value=0>男</option><option value=1>女</option></select></td>";
            BPI=BPI + "<td valign=\"top\" align=\"center\" rowspan=\"4\" class=\"weight120\">";
            BPI=BPI + "<img src=\"/cv/CV_Attach_Read.php?ReSumeID=52810628&27399135&AttachID=6882570\" width=\"90\" height=\"110\"/>";
            BPI=BPI + "</td>";
            BPI=BPI + "<td valign=\"top\" align=\"left\" class=\"weight80\" rowspan=\"4\">";
            BPI=BPI + "<img src=\"images_1/btn_amend.gif\" onclick=\"getUserInfo();\" style=\"cursor:pointer\"/>";
            BPI=BPI + "</td>";
            BPI=BPI + "</tr>";
            BPI=BPI + "<tr>";
            BPI=BPI + "<td valign=\"top\" align=\"right\">出生日期：</td>";
            BPI=BPI + "<td valign=\"top\"><select class=\"selectfield\" name=\"u_year\" id=\"u_year\" value="+userArr[2]+"></select>";
            BPI=BPI + "<select class=\"selectfield\" name=\"u_month\" id=\"u_month\" value="+userArr[3]+"></select>";
            BPI=BPI + "<select class=\"selectfield\" name=\"u_day\" id=\"u_day\" value="+userArr[4]+"></select></td>";
            BPI=BPI + "<td valign=\"top\" align=\"right\">工作年限：</td>";
            BPI=BPI + "<td valign=\"top\"><select class=\"selectfield\" name=\"u_workyear\" id=\"u_workyear\" value="+userArr[5]+"><option value=1>一年以上</option><option value=2>两年以上</option></select></td>";
            BPI=BPI + "</tr>";
            BPI=BPI + "<tr>";
            BPI=BPI + "<td valign=\"top\" align=\"right\">居住地：</td>";
            BPI=BPI + "<td valign=\"top\">"
            BPI=BPI + "<span id=\"Location_id\"><INPUT class=\"selebg2\" style=\"CURSOR: hand\" title=请选择地点 type=\"button\" value="+userArr[9]+" id=\"perNative\" name=\"perNative\" onClick=\"perNativeClick();\"></span>";
            BPI=BPI + "</td>";
            BPI=BPI + "<td valign=\"top\" align=\"right\">Email：</td>";
            BPI=BPI + "<td valign=\"top\"><input name=\"u_email\" type=\"text\" class=\"textfield\" id=\"u_email\" value="+userArr[6]+"></td>";
            BPI=BPI + "</tr>"
            BPI=BPI + "<tr>"
            BPI=BPI + "<td valign=\"top\" align=\"right\">手机号码：</td>";
            BPI=BPI + "<td colspan=\"4\"><input name=\"u_phone\" type=\"text\" class=\"textfield\" id=\"u_phone\" value="+userArr[7]+"></td>";
            BPI=BPI + "</tr>"
            BPI=BPI + "<tr>"
            BPI=BPI + "<td valign=\"top\" align=\"right\">户口：</td>";
            BPI=BPI + "<td colspan=\"4\"><input name=\"u_born\" type=\"button\" class=\"selebg2\" style=\"CURSOR: hand\" id=\"u_born\" value="+userArr[8]+" onClick=\"perNativeClick();\"></td>";
            BPI=BPI + "</tr>"
            BPI=BPI + "</table>"
            document.getElementById("BPI_info").innerHTML=BPI;
			SelectItemByText("u_sex",userArr[1]);SelectItemByText("u_year",userArr[2]);SelectItemByText("u_month",userArr[3]);SelectItemByText("u_day",userArr[4]);SelectItemByText("u_workyear",userArr[5]);
			var u_year = window.document.getElementById("u_year");
			var u_month = window.document.getElementById("u_month");
			var u_day = window.document.getElementById("u_day");
			var dt = new Date(userArr[2], userArr[3], userArr[4]);
			new DateSelector(u_year, u_month ,u_day, dt);
}
//更改为不可编辑状态
function getUserInfo(){
var arr = getUserInfoValue();
var userArr=arr.split(",");
var BPI="<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" class=\"weight780\">\r\n";
            BPI=BPI + "<tr>";
            BPI=BPI + "<td class=\"height10\"/>";
            BPI=BPI + "</tr>";
            BPI=BPI + "<tr>";
            BPI=BPI + "<td valign=\"top\" align=\"right\" class=\"weight125\">姓名：</td>";
            BPI=BPI + "<td valign=\"top\" align=\"left\" class=\"weight120\"><div id=\"u_name\">"+userArr[0]+"</div></td>";
            BPI=BPI + "<td valign=\"top\" align=\"right\" class=\"weight120\">性别：</td>";
            BPI=BPI + "<td valign=\"top\" width=\"210\"><div id=\"u_sex\">"+userArr[1]+"</div></td>";
            BPI=BPI + "<td valign=\"top\" align=\"center\" rowspan=\"4\" class=\"weight120\">";
            BPI=BPI + "<img src=\"/cv/CV_Attach_Read.php?ReSumeID=52810628&27399135&AttachID=6882570\" width=\"90\" height=\"110\"/>";
            BPI=BPI + "</td>";
            BPI=BPI + "<td valign=\"top\" align=\"left\" class=\"weight80\" rowspan=\"4\">";
            BPI=BPI + "<img src=\"images_1/btn_amend.gif\" onclick=\"editUserInfo();\" style=\"cursor:pointer\"/>";
            BPI=BPI + "</td>";
            BPI=BPI + "</tr>";
            BPI=BPI + "<tr>";
            BPI=BPI + "<td valign=\"top\" align=\"right\">出生日期：</td>";
            BPI=BPI + "<td valign=\"top\"><label id=\"u_year\">"+userArr[2]+"</label>-<label id=\"u_month\">"+userArr[3]+"</label>-<label id=\"u_day\">"+userArr[4]+"</label></td>";
            BPI=BPI + "<td valign=\"top\" align=\"right\">工作年限：</td>";
            BPI=BPI + "<td valign=\"top\"><div id=\"u_workyear\">"+userArr[5]+"</div></td>";
            BPI=BPI + "</tr>";
            BPI=BPI + "<tr>";
            BPI=BPI + "<td valign=\"top\" align=\"right\">居住地：</td>";
            BPI=BPI + "<td valign=\"top\">"
            BPI=BPI + "<span id=\"Location_id\">"+userArr[9]+"</span>";
            BPI=BPI + "</td>";
            BPI=BPI + "<td valign=\"top\" align=\"right\">Email：</td>";
            BPI=BPI + "<td valign=\"top\"><div id=\"u_email\">"+userArr[6]+"</div></td>";
            BPI=BPI + "</tr>"
            BPI=BPI + "<tr>"
            BPI=BPI + "<td valign=\"top\" align=\"right\">手机号码：</td>";
            BPI=BPI + "<td colspan=\"4\"><div id=\"u_phone\">"+userArr[7]+"</div></td>";
            BPI=BPI + "</tr>"
            BPI=BPI + "<tr>"
            BPI=BPI + "<td valign=\"top\" align=\"right\">户口：</td>";
            BPI=BPI + "<td colspan=\"4\"><div id=\"u_born\">"+userArr[8]+"</div></td>";
            BPI=BPI + "</tr>"
            BPI=BPI + "</table>"
            document.getElementById("BPI_info").innerHTML=BPI;
}
//非编辑模式下获取简历用户信息
function getUserInfoHTML(){
	var newArr = new Array();
	newArr[0]=document.getElementById("u_name").innerHTML;
	newArr[1]=document.getElementById("u_sex").innerHTML;
	newArr[2]=document.getElementById("u_year").innerHTML;
	newArr[3]=document.getElementById("u_month").innerHTML;
	newArr[4]=document.getElementById("u_day").innerHTML;
	newArr[5]=document.getElementById("u_workyear").innerHTML;
	newArr[6]=document.getElementById("u_email").innerHTML;
	newArr[7]=document.getElementById("u_phone").innerHTML;
	newArr[8]=document.getElementById("u_born").innerHTML;
	newArr[9]=document.getElementById("Location_id").innerHTML;
	var userString = newArr[0]+","+newArr[1]+","+newArr[2]+","+newArr[3]+","+newArr[4]+","+newArr[5]+","+newArr[6]+","+newArr[7]+","+newArr[8]+","+newArr[9];
	//alert(userString);
	return userString;
}
//编辑模式下获取简历用户信息
function getUserInfoValue(){
	var newArr = new Array();
	var u_year = window.document.getElementById("u_year");
	var u_month = window.document.getElementById("u_month");
	var u_day = window.document.getElementById("u_day");
	newArr[0]=document.getElementById("u_name").value;
	newArr[1]=document.getElementById("u_sex").options[document.getElementById("u_sex").selectedIndex].text;
	newArr[2]=u_year.options[u_year.selectedIndex].text;
	newArr[3]=u_month.options[u_month.selectedIndex].text;
	newArr[4]=u_day.options[u_day.selectedIndex].text;
	newArr[5]=document.getElementById("u_workyear").options[document.getElementById("u_workyear").selectedIndex].text;
	newArr[6]=document.getElementById("u_email").value;
	newArr[7]=document.getElementById("u_phone").value;
	newArr[8]=document.getElementById("u_born").value;
	newArr[9]=document.getElementById("perNative").value;
	var userString = newArr[0]+","+newArr[1]+","+newArr[2]+","+newArr[3]+","+newArr[4]+","+newArr[5]+","+newArr[6]+","+newArr[7]+","+newArr[8]+","+newArr[9];
	//alert(userString);
	return userString;
}

/*
 * 简历其他信息编辑
 * editInfo(class,id) | class=类别 | id=DIV的id |
 * getInfo(calss,id)  | class=类别 | id=DIV的id |
 */
 
//初始化EduEditON数据
function initEduEditON(id){
	var arr = getEduInfoOFF(id);
	var userArr=arr.split(",");
	var BPI="<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" class=\"weight780\">";
		BPI=BPI+"<tr>";
		BPI=BPI+"<td class=\"weight125\" valign=\"top\" align=\"right\">时间：</td>";
		BPI=BPI+"<td valign=\"top\" align=\"left\">";
		BPI=BPI + "<td valign=\"top\"><select class=\"selectfield\" name=Edu_year id=Edu_StartYear value="+userArr[0]+"></select>";
		BPI=BPI + "<select class=\"selectfield\" name=Edu_month id=Edu_StartMonth value="+userArr[1]+"></select>";
		BPI=BPI + "<select class=\"selectfield\" name=Edu_day id=Edu_EndYear value="+userArr[2]+"></select>";
		BPI=BPI + "<select class=\"selectfield\" name=Edu_day id=Edu_EndMonth value="+userArr[3]+"></select></td>";
		BPI=BPI+"<td class=\"weight80\" rowspan=\"2\" valign=\"top\" align=\"left\">";
		BPI=BPI+"<img src=\"images_1/btn_amend.gif\" style=\"cursor:pointer\" onclick=\"editinfo('Edu','40680161',1);\"/>";
		BPI=BPI+"</td></tr><tr>";
		BPI=BPI+"<td valign=\"top\" align=\"right\">学校：</td>";
		BPI=BPI+"<td valign=\"top\"><input name=school"+id+" id=school"+id+" type=\"text\" class=\"textfield\" value="+userArr[4]+"></td>";
		BPI=BPI+"</tr><tr>";
		BPI=BPI+"<td valign=\"top\" align=\"right\">专业：</td>";
		BPI=BPI+"<td colspan=\"2\" valign=\"top\"><input name=subject"+id+" id=subject"+id+" type=\"text\" class=\"textfield\" value="+userArr[5]+"></td>";
		BPI=BPI+"</tr><tr>";
		BPI=BPI+"<td valign=\"top\" align=\"right\">学历：</td>";
		BPI=BPI+"<td colspan=\"2\" valign=\"top\"><input name=degree"+id+" id=degree"+id+" type=\"text\" class=\"textfield\" value="+userArr[6]+"></td>";
		BPI=BPI+"</tr>";
		BPI=BPI+"</table>";
		BPI=BPI+"<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" class=\"linedot\">";
		BPI=BPI+"<tr>";
		BPI=BPI+"<td valign=\"top\"/>";
		BPI=BPI+"</tr>";
		BPI=BPI+"</table>";
	return BPI;
}
//写入EduEditON
function EduEditON(){
    
    initEduEditON(id)
}
//初始化EduEditOFF数据
function initEduEditOff(id){
    var arr = getEduInfoON(id);
    var userArr=arr.split(",");
    var BPI="<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" class=\"weight780\">";
        BPI=BPI+"<tr>";
        BPI=BPI+"<td class=\"weight125\" valign=\"top\" align=\"right\">时间：</td>";
        BPI=BPI+"<td valign=\"top\" align=\"left\">";
	    BPI=BPI+"<td valign=\"top\" align=\"left\"><div id=\"startDate"+id+"\">2006年9月</div>至<div id=\"endDate"+id+"\">今</div></td>";
        BPI=BPI+"<td class=\"weight80\" rowspan=\"2\" valign=\"top\" align=\"left\">";
        BPI=BPI+"<img src=\"images_1/btn_amend.gif\" style=\"cursor:pointer\" onclick=\"editinfo('Edu','40680161',1);\"/>";
        BPI=BPI+"</td>";
        BPI=BPI+"</tr>";
        BPI=BPI+"<tr>";
        BPI=BPI+"<td valign=\"top\" align=\"right\">学校：</td>";
        BPI=BPI+"<td valign=\"top\"><div id=\"school"+id+"\">广州城市职业学院</div></td>";
        BPI=BPI+"</tr>";
        BPI=BPI+"<tr>";
        BPI=BPI+"<td valign=\"top\" align=\"right\">专业：</td>";
        BPI=BPI+"<td colspan=\"2\" valign=\"top\"><div id=\"subject"+id+"\">subject</div></td>";
        BPI=BPI+"</tr>";
        BPI=BPI+"<tr>";
        BPI=BPI+"<td valign=\"top\" align=\"right\">学历：</td>";
        BPI=BPI+"<td colspan=\"2\" valign=\"top\"><div id=\"education"+id+"\">education</div></td>";
        BPI=BPI+"</tr>";
        BPI=BPI+"</table>";
        BPI=BPI+"<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" class=\"linedot\">";
        BPI=BPI+"<tr>";
        BPI=BPI+"<td valign=\"top\"/>";
        BPI=BPI+"</tr>";
        BPI=BPI+"</table>";
            document.getElementById("BPI_info").innerHTML=BPI;
			SelectItemByText("u_sex",userArr[1]);SelectItemByText("u_year",userArr[2]);SelectItemByText("u_month",userArr[3]);SelectItemByText("u_day",userArr[4]);SelectItemByText("u_workyear",userArr[5]);
			var u_year = window.document.getElementById("u_year");
			var u_month = window.document.getElementById("u_month");
			var u_day = window.document.getElementById("u_day");
			var dt = new Date(userArr[2], userArr[3], userArr[4]);
			new DateSelector(u_year, u_month ,u_day, dt);
}
//更改为不可编辑状态
function getUserInfo(){
var arr = getUserInfoValue();
var userArr=arr.split(",");
	var BPI="<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" class=\"weight780\">";
		BPI=BPI+"<tr>";
		BPI=BPI+"<td class=\"weight125\" valign=\"top\" align=\"right\">时间：</td>";
		BPI=BPI+"<td valign=\"top\" align=\"left\">";
		BPI=BPI + "<td valign=\"top\"><select class=\"selectfield\" name="+class+"_year id="+class+"_year value="+userArr[0]+"></select>";
		BPI=BPI + "<select class=\"selectfield\" name="+class+"_month id="+class+"_month value="+userArr[1]+"></select>";
		BPI=BPI + "<select class=\"selectfield\" name="+class+"_day id="+class+"_day value="+userArr[2]+"></select></td>";
		BPI=BPI+"<td class=\"weight80\" rowspan=\"2\" valign=\"top\" align=\"left\">";
		BPI=BPI+"<img src=\"images_1/btn_amend.gif\" style=\"cursor:pointer\" onclick=\"editinfo('"+id+"');\"/>";
		BPI=BPI+"</td></tr><tr>";
		BPI=BPI+"<td valign=\"top\" align=\"right\">学校：</td>";
		BPI=BPI+"<td valign=\"top\">广州城市职业学院</td>";
		BPI=BPI+"</tr><tr>";
		BPI=BPI+"<td valign=\"top\" align=\"right\">专业：</td>";
		BPI=BPI+"<td colspan=\"2\" valign=\"top\">软件工程</td>";
		BPI=BPI+"</tr><tr>";
		BPI=BPI+"<td valign=\"top\" align=\"right\">学历：</td>";
		BPI=BPI+"<td colspan=\"2\" valign=\"top\">大专</td>";
		BPI=BPI+"</tr>";
		BPI=BPI+"</table>";
		BPI=BPI+"<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" class=\"linedot\">";
		BPI=BPI+"<tr>";
		BPI=BPI+"<td valign=\"top\"/>";
		BPI=BPI+"</tr>";
		BPI=BPI+"</table>";
            document.getElementById("BPI_info").innerHTML=BPI;
}
//不可编辑状态，将div值转为字符串
function getUserInfoHTML(){
	var newArr = new Array();
	newArr[0]=document.getElementById("u_name").innerHTML;
	newArr[1]=document.getElementById("u_sex").innerHTML;
	newArr[2]=document.getElementById("u_year").innerHTML;
	newArr[3]=document.getElementById("u_month").innerHTML;
	newArr[4]=document.getElementById("u_day").innerHTML;
	newArr[5]=document.getElementById("u_workyear").innerHTML;
	newArr[6]=document.getElementById("u_email").innerHTML;
	newArr[7]=document.getElementById("u_phone").innerHTML;
	newArr[8]=document.getElementById("u_born").innerHTML;
	newArr[9]=document.getElementById("Location_id").innerHTML;
	var userString = newArr[0]+","+newArr[1]+","+newArr[2]+","+newArr[3]+","+newArr[4]+","+newArr[5]+","+newArr[6]+","+newArr[7]+","+newArr[8]+","+newArr[9];
	//alert(userString);
	return userString;
}
//编辑状态，将控件值转为字符串
function getUserInfoValue(){
	var newArr = new Array();
	var u_year = window.document.getElementById("u_year");
	var u_month = window.document.getElementById("u_month");
	var u_day = window.document.getElementById("u_day");
	newArr[0]=document.getElementById("u_name").value;
	newArr[1]=document.getElementById("u_sex").options[document.getElementById("u_sex").selectedIndex].text;
	newArr[2]=u_year.options[u_year.selectedIndex].text;
	newArr[3]=u_month.options[u_month.selectedIndex].text;
	newArr[4]=u_day.options[u_day.selectedIndex].text;
	newArr[5]=document.getElementById("u_workyear").options[document.getElementById("u_workyear").selectedIndex].text;
	newArr[6]=document.getElementById("u_email").value;
	newArr[7]=document.getElementById("u_phone").value;
	newArr[8]=document.getElementById("u_born").value;
	newArr[9]=document.getElementById("perNative").value;
	var userString = newArr[0]+","+newArr[1]+","+newArr[2]+","+newArr[3]+","+newArr[4]+","+newArr[5]+","+newArr[6]+","+newArr[7]+","+newArr[8]+","+newArr[9];
	//alert(userString);
	return userString;
}








//设置select中text="optionValue"的第一个Item为选中        
function SelectItemByText(id,optionValue){
    for (var i = 0; i < document.getElementById(id).options.length; i++) {    
        if (document.getElementById(id).options[i].text == optionValue) {  
            document.getElementById(id).options[i].selected = true;
            break;   
        }
    }     
}
/*年月日三级联动函数
 *调用方法
 *var dt = new Date(userArr[2], userArr[3], userArr[4]);
 *new DateSelector(u_year, u_month ,u_day, dt);
 */
function DateSelector(u_year, u_month, u_day)
{
    this.u_year = u_year;
    this.u_month = u_month;
    this.u_day = u_day;
    this.u_year.Group = this;
    this.u_month.Group = this;
    // 给年份、月份下拉菜单添加处理onchange事件的函数
    if(window.document.all != null) // IE
    {
        this.u_year.attachEvent("onchange", DateSelector.Onchange);
        this.u_month.attachEvent("onchange", DateSelector.Onchange);
    }
    else // Firefox
    {
        this.u_year.addEventListener("change", DateSelector.Onchange, false);
        this.u_month.addEventListener("change", DateSelector.Onchange, false);
    }

    if(arguments.length == 4) // 如果传入参数个数为4，最后一个参数必须为Date对象
        this.InitSelector(arguments[3].getFullYear(), arguments[3].getMonth(), arguments[3].getDate());
    else if(arguments.length == 6) // 如果传入参数个数为6，最后三个参数必须为初始的年月日数值
        this.InitSelector(arguments[3], arguments[4], arguments[5]);
    else // 默认使用当前日期
    {
        var dt = new Date();
        this.InitSelector(dt.getFullYear(), dt.getMonth(), dt.getDate());
    }
}
DateSelector.prototype.MinYear = 1939;// 增加一个最大年份的属性
DateSelector.prototype.MaxYear = (new Date()).getFullYear();// 增加一个最大年份的属性
DateSelector.prototype.InitYearSelect = function()// 初始化年份
{
    for(var i = this.MaxYear; i >= this.MinYear; i--) // 循环添加OPION元素到年份select对象中
    {
        var op = window.document.createElement("OPTION");// 新建一个OPTION对象
        op.value = i;// 设置OPTION对象的值
        op.innerHTML = i;// 设置OPTION对象的内容
        this.u_year.appendChild(op);// 添加到年份select对象
    }
}
// 初始化月份
DateSelector.prototype.InitMonthSelect = function()
{
    
    for(var i = 1; i < 13; i++)// 循环添加OPION元素到月份select对象中
    {
        var op = window.document.createElement("OPTION"); // 新建一个OPTION对象
        op.value = i;// 设置OPTION对象的值
        op.innerHTML = i; // 设置OPTION对象的内容
        this.u_month.appendChild(op);// 添加到月份select对象
    }
}

// 根据年份与月份获取当月的天数
DateSelector.DaysInMonth = function(year, month)
{
    var date = new Date(year, month, 0);
    return date.getDate();
}

// 初始化天数
DateSelector.prototype.InitDaySelect = function()
{
    
    var year = parseInt(this.u_year.value);// 使用parseInt函数获取当前的年份和月份
    var month = parseInt(this.u_month.value);
    
    
    var daysInMonth = DateSelector.DaysInMonth(year, month);// 获取当月的天数
    
    
    this.u_day.options.length = 0;// 清空原有的选项
    
    for(var i = 1; i <= daysInMonth ; i++)// 循环添加OPION元素到天数select对象中
    {
        var op = window.document.createElement("OPTION");// 新建一个OPTION对象
        op.value = i;// 设置OPTION对象的值
        op.innerHTML = i;// 设置OPTION对象的内容
        this.u_day.appendChild(op);// 添加到天数select对象
    }
}

// 处理年份和月份onchange事件的方法，它获取事件来源对象（即u_year或u_month）
// 并调用它的Group对象（即DateSelector实例，请见构造函数）提供的InitDaySelect方法重新初始化天数
// 参数e为event对象
DateSelector.Onchange = function(e)
{
    var selector = window.document.all != null ? e.srcElement : e.target;
    selector.Group.InitDaySelect();
}

// 根据参数初始化下拉菜单选项
DateSelector.prototype.InitSelector = function(year, month, day)
{
    // 由于外部是可以调用这个方法，因此我们在这里也要将u_year和u_month的选项清空掉
    // 另外因为InitDaySelect方法已经有清空天数下拉菜单，因此这里就不用重复工作了
    this.u_year.options.length = 0;
    this.u_month.options.length = 0;
    
    // 初始化年、月
    this.InitYearSelect();
    this.InitMonthSelect();
    
    // 设置年、月初始值
    this.u_year.selectedIndex = this.MaxYear - year;
    this.u_month.selectedIndex = month - 1;
    
    // 初始化天数
    this.InitDaySelect();
    
    // 设置天数初始值
    this.u_day.selectedIndex = day - 1;
}
